const createPromise = (): Promise<unknown> & {
  resolve: (value: unknown) => void;
  reject: (reason?: any) => void;
} => {
  let _resolve: (value: unknown) => void;
  let _reject: (reason?: any) => void;
  const promise = new Promise((resolve, reject) => {
    _resolve = resolve;
    _reject = reject;
  });
  // @ts-ignore
  promise.resolve = _resolve;
  // @ts-ignore
  promise.reject = _reject;
  // @ts-ignore
  return promise;
};

export default createPromise;
